SUBROUTINE HIDDEN
*Display a simple form, with name and address fields and checkboxes*for the user to select the type of information required*Include a form identifier as a hidden field*Include the RealWeb definitions
INCLUDE #RW.INCLUDE.DEFS FROM /SYSFILES/REALWEB,BP
* Start the HTML pageCALL RW_START_HTML_PAGE("Holiday Accommodation in South Ayrshire", "", "", "", "")CALL RW_PUT("There is a wide range of holiday accommodation available in South Ayrshire")CALL RW_NEWLINES(2)CALL RW_PUT("Fill in your name and address details then check the relevant box(es) to request details")
CALL RW_NEWLINES(2)* Start the HTML form, specifying that ACCOMDETAILS* should be run when the form is submittedCALL RW_START_HTML_FORM("ACCOMDETAILS", "SAREQUEST", "")*Put the form identifier into a hidden fieldCALL RW_HIDDEN("FORMID", "South Ayrshire", "")* Create the editboxesCALL RW_START_PARA("", "")CALL RW_PUT("Name: ")CALL RW_EDIT_BOX("NAME", 30,"")CALL RW_END_PARACALL RW_START_PARA("", "")CALL RW_PUT("Address: ")CALL RW_EDIT_BOX("ADD1", 30,"")CALL RW_END_PARACALL RW_START_PARA("", "")CALL RW_PUT(" ")CALL RW_PUT(" ")CALL RW_EDIT_BOX("ADD2", 30,"")CALL RW_END_PARACALL RW_START_PARA("", "")CALL RW_PUT(" ")CALL RW_PUT(" ")CALL RW_EDIT_BOX("ADD3", 30,"")CALL RW_END_PARACALL RW_START_PARA("","")CALL RW_PUT("Postcode: ")CALL RW_EDIT_BOX("PCODE", 7,"")CALL RW_END_PARA*Create the checkboxesCALL RW_CHECKBOX("accomtype","Hotels",0,0,"")CALL RW_PUT("Hotels")CALL RW_NEWLINECALL RW_CHECKBOX("accomtype","Bed and Breakfast",0,0,"")CALL RW_PUT("Bed and Breakfast")CALL RW_NEWLINECALL RW_CHECKBOX("accomtype","Self Catering",0,0,"")CALL RW_PUT("Self Catering")CALL RW_NEWLINECALL RW_CHECKBOX("accomtype","Camping",0,0,"")CALL RW_PUT("Camping")CALL RW_NEWLINES(2)*Create a reset buttonCALL RW_RESET("CLEAR","Clear Selections","")*Create the submit buttonCALL RW_SUBMIT_BUTTON("Submit Request","")*Complete the formCALL RW_END_FORM* Complete the pageCALL RW_END_PAGE
RETURN
SUBROUTINE ACCOMDETAILS
*Acknowledge request for details of holiday accommodation*in a specific area of Scotland*Include the RealWeb definitions
INCLUDE #RW.INCLUDE.DEFS FROM /SYSFILES/REALWEB,BP
EQU VM TO CHAR(253)
*Start the HTML pageCALL RW_START_HTML_PAGE("Request Acknowledgement", "", "", "", "")*Get the name and address from the submitted formCALL RW_GET_PARAM("NAME", NAME)CALL RW_GET_PARAM("ADD1", ADD1)CALL RW_GET_PARAM("ADD2", ADD2)CALL RW_GET_PARAM("ADD3", ADD3)CALL RW_GET_PARAM("PCODE",PCODE)*Get the form identifier - indicating the relevant area -*which was submitted as a hidden fieldCALL RW_GET_PARAM("FORMID", AREA)CALL RW_PUT("Thank you for your interest in holiday accommodation in ")CALL RW_PUT(AREA)CALL RW_NEWLINES(2)*Get the value of "accomtype" from the submitted form*Multiple checkboxes may be have been selected, so the value returned*will be a string of all selected modules separated by Value MarksCALL RW_GET_PARAM("accomtype", TYPES)
IF TYPES NE "" THEN
TYPES2 = CHANGE(TYPES, VM, ", ")
CALL RW_PUT('We will send details of the following "':TYPES2:'" to ')CALL RW_NEWLINECALL RW_PUT(NAME)CALL RW_NEWLINECALL RW_PUT(ADD1)CALL RW_NEWLINECALL RW_PUT(ADD2)CALL RW_NEWLINECALL RW_PUT(ADD3)CALL RW_NEWLINECALL RW_PUT(PCODE)
END
* Complete the pageCALL RW_END_PAGE
RETURN
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><HTML><HEAD><META NAME="Generator" CONTENT="Reality"><TITLE>Holiday Accommodation in South Ayrshire</TITLE></HEAD><BODY>
There is a wide range of holiday accommodation available in South Ayrshire
<BR><BR>
Fill in your name and address details then check the relevant box(es) to request details
<BR><BR><FORM ACTION="ACCOMDETAILS" NAME="SAREQUEST" METHOD="POST"><INPUT TYPE="HIDDEN" NAME="FORMID" VALUE="South Ayrshire"><P>
Name:
<INPUT NAME="NAME" SIZE="30" TYPE="TEXT"></P><P>
Address:
<INPUT NAME="ADD1" SIZE="30" TYPE="TEXT"></P><P>
<INPUT NAME="ADD2" SIZE="30" TYPE="TEXT"></P><P>
<INPUT NAME="ADD3" SIZE="30" TYPE="TEXT"></P><P>
Postcode:
<INPUT NAME="PCODE" SIZE="7" TYPE="TEXT"></P><INPUT TYPE=CHECKBOX NAME="accomtype" VALUE="Hotels">
Hotels
<BR><INPUT TYPE=CHECKBOX NAME="accomtype" VALUE="Bed and Breakfast">
Bed and Breakfast
<BR><INPUT TYPE=CHECKBOX NAME="accomtype" VALUE="Self Catering">
Self Catering
<BR><INPUT TYPE=CHECKBOX NAME="accomtype" VALUE="Camping">
Camping
<BR><BR><INPUT TYPE=RESET NAME="CLEAR" VALUE="Clear Selections"><INPUT TYPE="submit" VALUE="Submit Request"></FORM></BODY></HTML>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><HTML><HEAD><META NAME="Generator" CONTENT="Reality"><TITLE>Request Acknowledgement</TITLE></HEAD><BODY>
Thank you for your interest in holiday accommodation in
South Ayrshire
<BR><BR>
We will send details of the following "Bed and Breakfast, Self Catering" to
<BR>
Paul Williamson
<BR>
64 Meridian Way
<BR>
Barnet
<BR><BR><BR>
EN4 1AB
</BODY></HTML>